import Taro from '@tarojs/taro'
const baseURL='http://localhost:6789';
const http=(options)=>{
 return new Promise((resolve,reject)=>{
    Taro.request({
   url:baseURL+options.url,
   method:options.method || 'get',
   data:options.data || '{}',
   header:options.header || "{'content-type': 'application/json'}",
   success:function(res){
	   console.log(res)
    resolve(res.data);
   },
   fail:function(err){
    reject(err);
   }
  })
 })
}
export default http;